package com.spring.springboot.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import com.spring.springboot.entity.GoodInfoDTO;
import com.spring.springboot.entity.GoodInfoEntity;
import com.spring.springboot.entity.GoodTypeEntity;

/**
*@author LSY
*Time: 2018年12月19日下午5:35:01
*
*
*/
@Mapper(componentModel = "spring")
public interface GoodInfoMapper {

	@Mappings({
		@Mapping(source = "type.name", target = "typeName"),
		@Mapping(source = "good.id", target = "goodId"),
		@Mapping(source = "good.title", target = "goodName"),
		@Mapping(source =	 "good.price", target = "goodPrice")
	})
	public GoodInfoDTO from(GoodInfoEntity good, GoodTypeEntity type);
}
